//
//  errorcode.h
//  AncdaPlayer
//
//  Created by huangzan on 14-8-19.
//  Copyright (c) 2014年 huangzan. All rights reserved.
//

#ifndef AncdaPlayer_errorcode_h
#define AncdaPlayer_errorcode_h


enum ERROR_CODE{
    RESULT_OK   =                       0 ,
    RESULT_SESSION_EXIST=               1,  //请求建立的上传会话已经存在
    RESULT_CREATE_SESSION_FAILED=       2,  //创建会话失败
    RESULT_USER_EXIST=                  3,  //该用户已登录
    RESULT_SESSIONID_USED=              4,  //该会话已经存在，并且已被使用
    RESULT_NO_SESSION_EXIST=            5,  //所请求的会话不存在
    RESULT_ALREADY_EXIST=               6,  //你已经建立了上传会话，并试图再建立
    RESULT_PASSWORD_ERR=                7,  //用户名密码错误
    RESULT_REGIST_EXIST=                8 , //请求注册的用户已存在
    RESULT_MEMORY_ERROR=                9 , //内存错误
    RESULT_SSERVER_FAILED=              10 ,//分配流媒体服务器失败
    RESULT_RELOCATE_BIZ=                11 ,//用户不属于该业务服务器时，进行重定位
    RESULT_CR_CAMERA_FAILED =           12 ,//创建摄像机节点失败
    RESULT_CAMERA_MAX=                  13 ,//超出预定摄像机数量
    RESULT_SESSION_MAX=                 14 ,//超出节点数据
    RESULT_SESSIONID_INVALID =          15 ,
    RESULT_UPDATE_CAMERA =              16 ,
    RESULT_UPLOAD_FAILED =              17 ,//摄像机上行失败
    RESULT_USER_EXPIRE =                18 ,//用户账号过期
    RESULT_NOT_UPLOADERUSER=            19 ,//非上行用户试图登陆上行端
    RESULT_CAMERA_NO_EXIST =            20 ,//摄像机不存在
    RESULT_VERSION_ERROR =              21 ,//版本错误
    RESULT_USERTYPE_ERROR =             22 ,//用户类型错误，一般是上行端发送了播放端的登陆指令，或者播放端发送了上行端的登陆指令
    RESULT_USER_COUNT_MAX =             23 ,//已达到用户最大数量
    
    RESULT_DB_ERROR ,                       //数据库连接错误
    
};


#define SESSION_RIGHT_EXPIRE  0x00000001
#define SESSION_RIGHT_PTZ	  0x00000002
#define SESSION_RIGHT_TALK	  0x00000004
#define SESSION_RIGHT_RECORD  0x00000008
#define SESSION_RIGHT_SCREEN  0x00000020
#define SESSION_RIGHT_NODE    0x00000040
#define SESSION_RIGHT_USER    0x00000080
#define SESSION_RIGHT_ALARM   0x00000100

typedef enum
{
    pcDefault=-1,
    
    pcStop = 0,
    
    ptzLeft,
    ptzLeftStop ,
    
    ptzRight,
    ptzRightStop ,
    
    ptzUp,
    ptzUpStop ,
    
    ptzDown,
    ptzDownStop ,
    
    ptzCenter ,
    
    ptzLeftUp ,
    ptzLeftUpStop,
    
    ptzLeftDown ,
    ptzLeftDownStop ,
    
    ptzRightUp ,
    ptzRightUpStop ,
    
    ptzRightDown ,
    ptzRightDownStop ,
    
    ptzZoomIn ,			//放大+
    ptzZoomInStop ,
    
    ptzZoomOut ,		//放大-
    ptzZoomOutStop ,
    
    ptzFocusNear ,		//焦距+
    ptzFocusNearStop ,
    
    ptzFocusFar ,		//焦距-
    ptzFocusFarStop ,
    
    ptzLightAdd,		//光圈+
    ptzLightAddStop ,
    
    ptzLightDec ,		//光圈-
    ptzLightDecStop ,
    
    ptzVScan,			//垂直扫描
    ptzVScanStop ,
    
    ptzHScan ,			//水平扫描
    ptzHScanStop ,
    
    ptzPresetSave ,		//保存预置点
    ptzPresetCall ,
    
    ptzRemovePreset ,	//删除预置点
    ptzClearPreset ,
    
    ptzAutoScan,		//自动花样扫描
    ptzAutoScanStop ,
    
    ptzIOOn,			//IO开
    ptzIOOff ,
    
    ptzLightOn ,		//灯光
    ptzLightOff,
    
    ptzFanOn ,			//风扇
    ptzFanOff,
    
    ptzWiperOn ,		//雨刷
    ptzWiperOff ,
    
    ptzHeaterOn ,
    
    pcPtzEnd
}PtzCode;


typedef enum
{
	SessionConneting=0x301,
	SessionReConnecting = 0x302,
	SessionEncounteredError = 0x303,
	SessionLogining =0x304,
	SessionRequestList=0x306,
	SessionRefreshed=0x305,
	SessionPlayTimeExpire = 0x307,
    
	SessionPlayerError,
    
    
}SessionState;
typedef enum
{
	SessionNetworkFailed = 0x401,
	SessionLoginFailed = 0x402,
	SessionFailed = 0x403,
	SessionExpire = 0x404,
    
	SessionOtherFailed=0x4ff,
}SessionError;


typedef enum
{
	StreamConneting=0x101,
	StreamOpening = 0x102,
	StreamOpened = 0x103,
	StreamPlaying = 0x104,
	StreamPaused = 0x105,
	StreamStopped = 0x106,
	StreamReConnecting = 0x107,
	StreamEndReached = 0x108,
	StreamEncounteredError = 0x10a,
	StreamLogining =0x10b,
	StreamTalkState ,
    
}StreamState;
typedef enum
{
	StreamNetworkFailed = 0x201,
	StreamLoginFailed = 0x202,
    
    
	StreamChannelFailed = 0x203,
	StreamRightFailed,
	StreamDeviceFailed,
	StreamOtherFailed=0x2ff,
    
}PlayerError;

typedef enum
{
	vdStart =0, //线程启动
	vdI420,
	vdH264,
	vdExit//线程退出,
}VideoData;

typedef enum
{
	ftIFrame,
	ftPFrame,
	ftUnknown,
    
}FrameType;

#define MAX_STRING_LEN 64

#define NETWORK_AUTO 0
#define NETWORK_2G 1
#define NETWORK_3G 2
#define NETWORK_WIFI 3


#endif
